import java.io.*;
import java.util.Scanner;

/**
 * Created by abdulazizalonizi on 7/18/17.
 */
public class Task5 {
    public static void main (String [] args)
    {
        try {
            FileInputStream inStream = new FileInputStream("File1.txt");
            Scanner fin = new Scanner(inStream);
            FileOutputStream ostream = new FileOutputStream("File2.txt", true);
            PrintWriter printW = new PrintWriter(ostream);

            FileInputStream inStream2 = new FileInputStream("File2.txt");
            Scanner fin2 = new Scanner (inStream2);


            for (int i = 0; i < 4; i++)
            {
                String s = fin.nextLine();

                printW.print(s + "\n");

            }
            printW.close();
            fin.close();


            for (int i = 0 ; i < 8 ; i++)
            {
                String s2 = fin2.nextLine();
                System.out.println(s2 + "\n");


            }

        } catch(Exception me)
        {
            System.out.println("Exception found !");
        }



    }
}
